package com.jin.webvideo.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface ConfigMapper {

    @Select("select attrKey, attrVal, description from config where groupid=#{group}")
    public List<Map<String,String>> findByGroup(String group);

    @Select("select attrVal from config where attrKey=#{attrId} and groupid=#{group}")
    public String findValByGroupAndId(String group, String attrId);

    @Update("update config set attrVal=#{val} where attrKey=#{attrId} and groupid=#{group}")
    public int updateValByGroupAndId(String group, String attrId, String val);
    @Select("select attrVal from config where groupid=#{group}")
    public List<String> findValByGroup(String group);

}
